/**
 * 
 */
package de.uni_leipzig.informatik.asv.util;
/**
 * 
 * @author Christoph Teichmann
 * created Jan 15, 2014 10:01:05 PM
 * @version 0.1
 */
public class IntegerCombine
{
	/**
	 * 
	 */
	private final static long ANDTERM = (-1L >>> Integer.SIZE);
	/**
	 * 
	 *
	 * @param arg1
	 * @param arg2
	 * @return
	 */
	public static long combine(int arg1,int arg2)
	{
		long ret = arg1;
		ret = (ret << Integer.SIZE) | ((arg2) & ANDTERM);
		return ret;
	}
	/**
	 * 
	 * @return
	 */
	public static int getFirst(long code)
	{return (int) (code >>> Integer.SIZE);}
	/**
	 * 
	 * @param code
	 * @return
	 */
	public static int getSecond(long code)
	{return (int) code;}
}